package com.aimei.www.moduel.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.data.mongodb.core.MongoTemplate;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


@Controller
@RequestMapping("/api/auth")
@EnableAutoConfiguration
public class TokenMakeController {
       /*@Autowired
       @Qualifier(value = "mongoTemplate")
       protected MongoTemplate mongoTemplate;

       @RequestMapping("/tokenMakeByPassword")
       public ResponseEntity tokenMakeByPassword(HttpServletRequest re, HttpServletResponse rq) {
              return new ResponseEntity(HttpStatus.ACCEPTED);
       }

       @RequestMapping("/mongoTest")
       @ResponseBody
       public boolean mongoTest() {
             *//* Map map = new HashMap();
              map.put("name", "小花");
              map.put("age", "18");
              User uu = new User();
              uu.setName("小花");
              mongoTemplate.insert(uu);
              Query query = new Query();
              Criteria criteria = new Criteria();
              criteria.and("name").is("小花");
              query.addCriteria(criteria);
              Update update = new Update();
              update.set("name", "ashd");
              mongoTemplate.upsert(query, update, User.class);*//*
              return true;
       }*/
}
